<?php

/* Portal Pracy - praca magisterska
 * autor: Tomek Ceszke
 * email: tomek.ceszke@gmail.com
 * Politechnika Koszalińska 2007
 */

class Group extends AppModel
{
	var $name = 'Group';

	var $hasMany = array
	(
		'User' => array
		(
			'className'     => 'User',
            'foreignKey'    => 'group_id',
            'dependent'     => true,
            'exclusive'     => false,
         )
	);
				
	var $hasAndBelongsToMany = array
	(
		'Permission' => array
		(
			'className' => 'Permission',
			'joinTable' => 'groups_permissions',
			'foreignKey' => 'group_id',
    		'associationForeignKey'=>'permission_id'	
		)
	);
		
}
?>